home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (C) 1989, 1992, 1993 Aladdin Enterprises. All rights reserved.
-
- This file is part of Ghostscript.
-
- Ghostscript is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
- to anyone for the consequences of using it or for whether it serves any
- particular purpose or works at all, unless he says so in writing. Refer
- to the Ghostscript General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute
- Ghostscript, but only under the conditions described in the Ghostscript
- General Public License. A copy of this license is supposed to have been
- given to you along with Ghostscript so you can know your rights and
- responsibilities. It should be in a file named COPYING. Among other
- things, the copyright notice and this notice must be preserved on all
- copies. */
-
- /* gp_atari.h */
-
- /* Ghostscript header file for the Atari platform. */
-
- #include "memory_.h"
- #include "string_.h"
- #include "gx.h"
- #include "gp.h"
- #include "stat_.h"
- #include "time_.h"
- #include "gserrors.h"
- #include "gsmatrix.h" /* for gxdevice.h */
- #include "gxdevice.h"
- #include "stream.h"
- #include "filedev.h" /* must come after stream.h */
- #include "math_.h"
-
- #include <stdlib.h>
- #include <stdarg.h>
- #include <gemdefs.h>
- #include <aesbind.h>
- #include <vdibind.h>
-
- #define MIN(x, y) ((x <= y) ? x : y)
- #define MAX(x, y) ((x >= y) ? x : y)
-
- #define ON (1)
- #define OFF (0)
- #define MAXLEN (256)
-
- #define WM_UNTOPPED (30)
- #define WM_ONTOP (31)
- #define COMMAND (60) /* New message type. */
-
- #define INITLINES (13)
- #define LINES (24)
- #define COLUMNS (80)
- #define CLIMIT (COLUMNS + 2)
-
- /* Definitions for GEM. */
-
- #define W_GADGETS (NAME+CLOSER+MOVER+SIZER+FULLER+VSLIDE\
- +HSLIDE+UPARROW+DNARROW+LFARROW+RTARROW)
- #define T_GADGETS (NAME+CLOSER+MOVER+SIZER+FULLER+VSLIDE\
- +HSLIDE+UPARROW+DNARROW+LFARROW+RTARROW)
- #define I_GADGETS (NAME+MOVER+FULLER)
- #define D_GADGETS (CLOSER+NAME+MOVER)
-
- #define W_TITL " GS Image "
- #define T_TITL " GS Console "
- #define I_TITL " GS "
- #define D_TITL " About ST-GS"
-
- #define UL (unsigned long)
-
- #define OK 9
- #define ABOUT 11
- #define RUN 20
- #define NEXT 21
- #define QUIT 22
- #define ICON 27
- #define TOGTOP 28
-
- #define DIRT_RECT 0 /* Redraw only the dirty part of the window. */
- #define FULL_WIN 1 /* Redraw the full window. */
-
- #define DEFINED_INTENSITY 0
-
- #define DITH_RGB(depth)\
- (depth == 16 ? 40 : depth == 8 ? 6 : depth == 4 ? 2 : depth == 2 ? 2 : 1)
-
- typedef struct window {
- short handle; /* window handle */
- short gadgets; /* which window gadgets are enabled */
- short opened; /* flag for window state */
- char *title; /* pointer to window title */
- GRECT canvas; /* size of window work area */
- GRECT frame; /* sized of entire window */
- GRECT oframe; /* last frame size */
- GRECT mframe; /* maximum frame size */
- int (*redraw)(); /* routine for window redraw */
- } WINDOW;
-
- typedef struct textwin {
- WINDOW *win; /* pointer to an associated window structure */
- char text[LINES][COLUMNS+1]; /* text buffer */
- short top; /* position of the top of page wrt screen */
- short edge; /* position of the left edge of page wrt screen */
- short xoff, yoff; /* offset of text wrt top left corner of page */
- short cx, cy; /* cursor position in raster coordinates */
- short cstate; /* cursor state (on/off) */
- short wc, hc; /* width and height of the current font */
- short lins, cols; /* width and height of the textwin in characters */
- short ln, cn; /* the current line and column */
- short fl, ll; /* first and last lines in the text buffer */
- short fdl, ldl; /* first and last displayed lines */
- short fdc, ldc; /* first and last displayed columns */
- short scrolled; /* state of scrolling */
- } TEXTWIN;
-
- /* Menu bar when windows are enabled. */
-
- OBJECT menu[] = {
-
- /* 0 */ {-1, 1, 9, G_IBOX, 0, 0, 0L, 0, 0, 80, 25},
- /* 1 */ { 9, 2, 2, G_BOX , 0, 0, 0x1100L, 0, 0, 80, 513},
-
- /* 2 */ { 1, 3, 5, G_IBOX, 0, 0, 0L, 2, 0, 20, 769},
- /* 3 */ { 4, -1, -1, G_TITLE, 0, 0, UL" ST-GS ", 0, 0, 7, 769},
- /* 4 */ { 5, -1, -1, G_TITLE, 0, 0, UL" File ", 7, 0, 6, 769},
- /* 5 */ { 2, -1, -1, G_TITLE, 0, 0, UL" Window ", 13, 0, 8, 769},
- /* 6 */ { 7, -1, -1, G_TITLE, 0, DISABLED, UL"", 21, 0, 10, 769},
- /* 7 */ { 8, -1, -1, G_TITLE, 0, DISABLED, UL"", 31, 0, 10, 769},
- /* 8 */ { 2, -1, -1, G_TITLE, 0, DISABLED, UL"", 41, 0, 10, 769},
-
- /* 9 */ { 0, 10, 26, G_IBOX, 0, 0, 0L, 0, 769, 80, 19},
-
- /* 10 */ { 19, 11, 18, G_BOX , 0, 0, 0xff1100L, 2, 0, 20, 8},
- /* 11 */ { 12, -1, -1, G_STRING , 0, 0, UL" About ST-GS", 0, 0, 20, 1},
- /* 12 */ { 13, -1, -1, G_STRING , 0, 0x08, UL" ------------------ ", 0, 1, 20, 1},
- /* 13 */ { 14, -1, -1, G_STRING , 0, 0, UL"1", 0, 2, 20, 1},
- /* 14 */ { 15, -1, -1, G_STRING , 0, 0, UL"2", 0, 3, 20, 1},
- /* 15 */ { 16, -1, -1, G_STRING , 0, 0, UL"3", 0, 4, 20, 1},
- /* 16 */ { 17, -1, -1, G_STRING , 0, 0, UL"4", 0, 5, 20, 1},
- /* 17 */ { 18, -1, -1, G_STRING , 0, 0, UL"5", 0, 6, 20, 1},
- /* 18 */ { 10, -1, -1, G_STRING , 0, 0, UL"6", 0, 7, 20, 1},
-
- /* 19 */ { 26, 20, 22, G_BOX , 0, 0, 0xff1100L, 9, 0, 16, 3},
- /* 20 */ { 21, -1, -1, G_STRING , 0, 0, UL" Run ❎r ", 0, 0, 16, 1},
- /* 21 */ { 22, -1, -1, G_STRING , 0, 0, UL" Next Page ❎n ", 0, 1, 16, 1},
- /* 22 */ { 19, -1, -1, G_STRING , 0, 0, UL" Quit GS ❎q ", 0, 2, 16, 1},
- /* 23 */ { 24, -1, -1, G_STRING , 0, DISABLED, UL"", 0, 3, 16, 1},
- /* 24 */ { 25, -1, -1, G_STRING , 0, DISABLED, UL"", 0, 4, 16, 1},
- /* 25 */ { 19, -1, -1, G_STRING , 0, DISABLED, UL"", 0, 5, 16, 1},
-
- /* 26 */ { 9, 27, 28, G_BOX , 0, 0, 0xff1100L, 15, 0, 16, 2},
- /* 27 */ { 28, -1, -1, G_STRING , 0, 0, UL" Iconify ❎i ", 0, 0, 16, 1},
- /* 28 */ { 26, -1, -1, G_STRING , 0, 0, UL" Toggle Top ❎t ", 0, 1, 16, 1},
- /* 29 */ { 30, -1, -1, G_STRING , 0, DISABLED, UL"", 0, 2, 16, 1},
- /* 30 */ { 31, -1, -1, G_STRING , 0, DISABLED, UL"", 0, 3, 16, 1},
- /* 31 */ { 32, -1, -1, G_STRING , 0, DISABLED, UL"", 0, 4, 16, 1},
- /* 32 */ { 26, -1, -1, G_STRING , LASTOB, DISABLED, UL"", 0, 5, 16, 1}
-
- };
-
- /* About stvdi dialog object. */
-
- OBJECT about[] = {
- /* 0 */ {-1, 1, 9, G_BOX, 0, 16, 0x00021100L, 0, 0, 29, 15},
- /* 1 */ { 2, -1, -1, G_STRING, 0, 0, UL"Ghostscript Screen Driver", 2, 1, 25, 1},
- /* 2 */ { 3, -1, -1, G_STRING, 0, 0, UL"For The Atari ST", 6, 2, 16, 1},
- /* 3 */ { 4, -1, -1, G_STRING, 0, 0, UL"Tim Gallivan, 1993", 5, 3, 18, 1},
- /* 4 */ { 5, -1, -1, G_STRING, 0, 0, UL"Image Window Accelerators", 2, 5, 25, 1},
- /* 5 */ { 6, -1, -1, G_STRING, 0, 0, UL"\001\002: Page Up/Down", 5, 7, 16, 1},
- /* 6 */ { 7, -1, -1, G_STRING, 0, 0, UL"\004\003: Page Left/Right", 5, 8, 19, 1},
- /* 7 */ { 8, -1, -1, G_STRING, 0, 0, UL"Scroll Bar Arrows", 6, 10, 17, 1},
- /* 8 */ { 9, -1, -1, G_STRING, 0, 0, UL"Move to Page Edges.", 5, 11, 19, 1},
- /* 9 */ { 0, -1, -1, G_BUTTON, 0x62, 0, UL" OK ", 11, 13, 6, 1}
- };
-
- #include "noghost.c" /* File containing ghostscript icon definitions. */
-
- /* Real versions of the following functions are needed in gp_atari. */
-
- #undef fputc
- #undef fputs
- #undef fwrite
-
- /* end gp_atari.h */
-